<?php
    header('Content-type:text/json');
    require "../connection.php";
    $data = array();
    $res = $conn->doSql("select count(*) from category");
    $len = $res[0]["count(*)"];
    for($i=0;$i<$len;$i++){
        $sql = "select * from goods where goods_categoryid = ".($i+1);
        $result= $conn->doSql($sql);
        $arr = array($i=>$result);
        array_push($data,$arr);
    }
   echo json_encode($data);



?>